/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Medicamentos;

import Funcionario.Funcionario;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.Session;
import util.HibernateUtil;

/**
 *
 * @author Davi
 */
public class MedicamentosDAO {
    
    private Session sessao;
    private Transaction transacao;
    
    public void salvar(Medicamento funcionario){
        
        sessao = HibernateUtil.getSessionFactory().openSession();
        transacao = sessao.beginTransaction();
        sessao.save(funcionario);
        transacao.commit();
        sessao.close();
        
    }
    
    
}
